const doban=require("../../libraries/douban.js");
Page({
  data:{
    movies:[],
    loading:true,
    boards: [
      { key: 'in_theaters', name: '正在热映' },
      { key: 'coming_soon', name: '即将上映' },
      { key: 'top250', name: 'T0P250' },
      // { key: 'weekly', name: '口碑榜' },
      { key: 'us_box', name: '北美票房榜' },
      // { key: 'new_movies', name: '新片榜' }
    ],
  },
  onLoad:function(options){
    doban.find("in_theaters",1,5)
         .then(d=>{
           this.setData({movies:d.subjects,loading:false});
           console.log(d);
           })
         .catch(e=>{
             console.error(e);
             this.setData({movies:[],loading:false});
         });
  },
  onReady:function(){
    // 页面渲染完成
  },
  onShow:function(){
    // 页面显示
  },
  onHide:function(){
    // 页面隐藏
  },
  onUnload:function(){
    
  }
})